using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using Beaker.OpenCube.Render.Maths;

namespace Beaker.OpenCube.Render
{
	public sealed class Ray
	{
		private readonly Point3 _origin;
		private readonly Vector3 _direction;

		public Ray( Point3 origin, Vector3 direction )
		{
			Contract.Requires( direction.IsNormalized() == true, "direction should be normalized" );

			_origin = origin;
			_direction = direction;
		}

		/// <summary>
		/// Gets the origin point of the ray (o)
		/// </summary>
		[Pure]
		public Point3 Origin
		{
			
			get { return _origin; }
		}

		/// <summary>
		/// Gets the direction of the ray (d)
		/// </summary>
		[Pure]
		public Vector3 Direction
		{
			
			get { return _direction; }
		}
	}
}